function log(...args: any) {
  let logs = [`[${getTime()}]`]
  logs = logs.concat(args || [])
  console.groupCollapsed(...logs)
  console.trace() // hidden in collapsed group
  console.groupEnd()
}

export default function () {
  return { log }
}

function getTime() {
  const d = new Date()
  // return `${d.getFullYear()}-${d.getMonth()}-${d.getDay()} ${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}:${d.getTime() % 1000}`
  return `${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}:${d.getTime() % 1000}`
}
